<html>
<head><meta charset="utf-8"><title>Separating rustc and library workspaces · t-infra · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/index.html">t-infra</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html">Separating rustc and library workspaces</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="209466743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209466743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209466743">(Sep 09 2020 at 02:47)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/76446#issuecomment-688433733">https://github.com/rust-lang/rust/pull/76446#issuecomment-688433733</a>:</p>
<blockquote>
<p>I suspect having two workspaces in rust-lang/rust might be a good idea long-term regardless to lessen various other pains, so I wouldn't mind having a dedicated library workspace. That'll take some work, though.</p>
</blockquote>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> do you have suggestions for getting started with this?</p>



<a name="209467081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467081">(Sep 09 2020 at 02:55)</a>:</h4>
<p>Not really, beyond just doing it and looking at errors that result.</p>



<a name="209467137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467137">(Sep 09 2020 at 02:56)</a>:</h4>
<p>well, adding <code>[workspace]</code> to <code>library/test/Cargo.toml</code> immediately comes up with 151 of</p>
<div class="codehilite"><pre><span></span><code><span class="n">error</span><span class="p">[</span><span class="n">E0412</span><span class="p">]</span>: <span class="nc">cannot</span><span class="w"> </span><span class="n">find</span><span class="w"> </span><span class="k">type</span> <span class="err">`</span><span class="n">c_void</span><span class="err">`</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="k">crate</span><span class="w"> </span><span class="n">root</span><span class="w"></span>
<span class="w">   </span><span class="o">-</span>-&gt; <span class="o">/</span><span class="n">home</span><span class="o">/</span><span class="n">joshua</span><span class="o">/</span><span class="p">.</span><span class="n">local</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">cargo</span><span class="o">/</span><span class="n">registry</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">github</span><span class="p">.</span><span class="n">com</span><span class="o">-</span><span class="mi">1</span><span class="n">ecc6299db9ec823</span><span class="o">/</span><span class="n">libc</span><span class="o">-</span><span class="mf">0.2.76</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">unix</span><span class="o">/</span><span class="n">linux_like</span><span class="o">/</span><span class="n">linux</span><span class="o">/</span><span class="n">gnu</span><span class="o">/</span><span class="n">b64</span><span class="o">/</span><span class="n">x86_64</span><span class="o">/</span><span class="n">not_x32</span><span class="p">.</span><span class="n">rs</span>:<span class="mi">420</span>:<span class="mi">22</span><span class="w"></span>
<span class="w">    </span><span class="o">|</span><span class="w"></span>
<span class="mi">420</span><span class="w"> </span><span class="o">|</span><span class="w">         </span><span class="n">newp</span>: <span class="o">*</span><span class="k">mut</span><span class="w"> </span>::<span class="n">c_void</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="o">|</span><span class="w">                      </span><span class="o">^^^^^^</span><span class="w"> </span><span class="n">not</span><span class="w"> </span><span class="n">found</span><span class="w"> </span><span class="k">in</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="k">crate</span><span class="w"> </span><span class="n">root</span><span class="w"></span>
</code></pre></div>



<a name="209467138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467138">(Sep 09 2020 at 02:56)</a>:</h4>
<p>not sure why yet</p>



<a name="209467149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467149">(Sep 09 2020 at 02:57)</a>:</h4>
<p>maybe it's conflicting with the top-level workspace?</p>



<a name="209467364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467364">(Sep 09 2020 at 03:02)</a>:</h4>
<p>wouldn't you want the workspace to be in <code>library</code> instead of <code>library/test</code>?</p>



<a name="209467372"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467372" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467372">(Sep 09 2020 at 03:02)</a>:</h4>
<p><span class="user-mention" data-user-id="281757">@Jubilee</span> yes, but it's easy enough to change the file location and it's the same error in both places</p>



<a name="209467379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467379">(Sep 09 2020 at 03:03)</a>:</h4>
<p>ah</p>



<a name="209467441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467441">(Sep 09 2020 at 03:04)</a>:</h4>
<p>does it go away if you just dump all of the root's dependencies into a Cargo.toml in <code>./library</code>?</p>



<a name="209467580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467580">(Sep 09 2020 at 03:08)</a>:</h4>
<p>I don't quite follow</p>



<a name="209467581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467581">(Sep 09 2020 at 03:08)</a>:</h4>
<p>by root are you including the compiler too?</p>



<a name="209467993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209467993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209467993">(Sep 09 2020 at 03:18)</a>:</h4>
<p>yeah, root of /rust/</p>



<a name="209468062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468062">(Sep 09 2020 at 03:20)</a>:</h4>
<p>oh right, that is it's own.... hm.</p>



<a name="209468536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468536">(Sep 09 2020 at 03:30)</a>:</h4>
<p>ok this is giving me some hints</p>
<div class="codehilite"><pre><span></span><code>diff --git a/Cargo.lock b/Cargo.lock
index b84f6ef51ac..ffdfbe541fa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6,10 +6,7 @@ version = &quot;0.13.0&quot;
 source = &quot;registry+https://github.com/rust-lang/crates.io-index&quot;
 checksum = &quot;1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072&quot;
 dependencies = [
- &quot;compiler_builtins&quot;,
  &quot;gimli&quot;,
- &quot;rustc-std-workspace-alloc&quot;,
- &quot;rustc-std-workspace-core&quot;,
 ]
</code></pre></div>



<a name="209468542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468542">(Sep 09 2020 at 03:30)</a>:</h4>
<p>let me try adding those</p>



<a name="209468718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468718">(Sep 09 2020 at 03:34)</a>:</h4>
<p>oh I was warmer than I thought, even!</p>



<a name="209468844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468844">(Sep 09 2020 at 03:36)</a>:</h4>
<p>hmm not sure how to actually add those dependencies</p>



<a name="209468850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468850">(Sep 09 2020 at 03:37)</a>:</h4>
<p>they only have <code>[patch.crates.io]</code> in the root cargo.toml</p>



<a name="209468854"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468854" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468854">(Sep 09 2020 at 03:37)</a>:</h4>
<p>in the Cargo.toml they're added as patches, yes. Try that?</p>



<a name="209468870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209468870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209468870">(Sep 09 2020 at 03:37)</a>:</h4>
<p>no dice</p>



<a name="209469037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209469037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209469037">(Sep 09 2020 at 03:40)</a>:</h4>
<p>tried adding bootstrap as a member but that gives an error that it's a member of two workspaces</p>



<a name="209469331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209469331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209469331">(Sep 09 2020 at 03:46)</a>:</h4>
<p>actually the very first error is</p>
<div class="codehilite"><pre><span></span><code>error[E0433]: failed to resolve: could not find `prelude` in `core`
</code></pre></div>



<a name="209469417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209469417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209469417">(Sep 09 2020 at 03:48)</a>:</h4>
<p>not making much progress here, going to work on <a href="https://github.com/rust-lang/compiler-team/issues/351">https://github.com/rust-lang/compiler-team/issues/351</a> instead</p>



<a name="209485789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209485789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209485789">(Sep 09 2020 at 08:47)</a>:</h4>
<div class="spoiler-block"><div class="spoiler-header">

<p>diff</p>
</div><div class="spoiler-content" aria-hidden="true">

<div class="codehilite"><pre><span></span><code><span class="gh">diff --git a/Cargo.toml b/Cargo.toml</span>
<span class="gh">index fde1cb5a35c..918ba3261f1 100644</span>
<span class="gd">--- a/Cargo.toml</span>
<span class="gi">+++ b/Cargo.toml</span>
<span class="gu">@@ -2,8 +2,6 @@</span>
 members = [
   &quot;src/bootstrap&quot;,
   &quot;compiler/rustc&quot;,
<span class="gd">-  &quot;library/std&quot;,</span>
<span class="gd">-  &quot;library/test&quot;,</span>
   &quot;src/tools/cargotest&quot;,
   &quot;src/tools/clippy&quot;,
   &quot;src/tools/compiletest&quot;,
<span class="gu">@@ -34,40 +32,6 @@ exclude = [</span>
   &quot;obj&quot;,
 ]

<span class="gd">-[profile.release.package.compiler_builtins]</span>
<span class="gd">-# The compiler-builtins crate cannot reference libcore, and it&#39;s own CI will</span>
<span class="gd">-# verify that this is the case. This requires, however, that the crate is built</span>
<span class="gd">-# without overflow checks and debug assertions. Forcefully disable debug</span>
<span class="gd">-# assertions and overflow checks here which should ensure that even if these</span>
<span class="gd">-# assertions are enabled for libstd we won&#39;t enable then for compiler_builtins</span>
<span class="gd">-# which should ensure we still link everything correctly.</span>
<span class="gd">-debug-assertions = false</span>
<span class="gd">-overflow-checks = false</span>
<span class="gd">-</span>
<span class="gd">-# For compiler-builtins we always use a high number of codegen units.</span>
<span class="gd">-# The goal here is to place every single intrinsic into its own object</span>
<span class="gd">-# file to avoid symbol clashes with the system libgcc if possible. Note</span>
<span class="gd">-# that this number doesn&#39;t actually produce this many object files, we</span>
<span class="gd">-# just don&#39;t create more than this number of object files.</span>
<span class="gd">-#</span>
<span class="gd">-# It&#39;s a bit of a bummer that we have to pass this here, unfortunately.</span>
<span class="gd">-# Ideally this would be specified through an env var to Cargo so Cargo</span>
<span class="gd">-# knows how many CGUs are for this specific crate, but for now</span>
<span class="gd">-# per-crate configuration isn&#39;t specifiable in the environment.</span>
<span class="gd">-codegen-units = 10000</span>
<span class="gd">-</span>
<span class="gd">-# These dependencies of the standard library implement symbolication for</span>
<span class="gd">-# backtraces on most platforms. Their debuginfo causes both linking to be slower</span>
<span class="gd">-# (more data to chew through) and binaries to be larger without really all that</span>
<span class="gd">-# much benefit. This section turns them all to down to have no debuginfo which</span>
<span class="gd">-# helps to improve link times a little bit.</span>
<span class="gd">-[profile.release.package]</span>
<span class="gd">-addr2line.debug = 0</span>
<span class="gd">-adler.debug = 0</span>
<span class="gd">-gimli.debug = 0</span>
<span class="gd">-miniz_oxide.debug = 0</span>
<span class="gd">-object.debug = 0</span>
<span class="gd">-</span>
 # We want the RLS to use the version of Cargo that we&#39;ve got vendored in this
 # repository to ensure that the same exact version of Cargo is used by both the
 # RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository
<span class="gu">@@ -87,12 +51,6 @@ rustfmt-nightly = { path = &quot;src/tools/rustfmt&quot; }</span>
 # here
 rustc-workspace-hack = { path = &#39;src/tools/rustc-workspace-hack&#39; }

<span class="gd">-# See comments in `library/rustc-std-workspace-core/README.md` for what&#39;s going on</span>
<span class="gd">-# here</span>
<span class="gd">-rustc-std-workspace-core = { path = &#39;library/rustc-std-workspace-core&#39; }</span>
<span class="gd">-rustc-std-workspace-alloc = { path = &#39;library/rustc-std-workspace-alloc&#39; }</span>
<span class="gd">-rustc-std-workspace-std = { path = &#39;library/rustc-std-workspace-std&#39; }</span>
<span class="gd">-</span>
 # This crate&#39;s integration with libstd is a bit wonky, so we use a submodule
 # instead of a crates.io dependency. Make sure everything else in the repo is
 # also using the submodule, however, so we can avoid duplicate copies of the
<span class="gh">diff --git a/library/Cargo.toml b/library/Cargo.toml</span>
new file mode 100644
<span class="gh">index 00000000000..f0ea550b815</span>
<span class="gd">--- /dev/null</span>
<span class="gi">+++ b/library/Cargo.toml</span>
<span class="gu">@@ -0,0 +1,46 @@</span>
<span class="gi">+[workspace]</span>
<span class="gi">+members = [</span>
<span class="gi">+  &quot;./std&quot;,</span>
<span class="gi">+  &quot;./test&quot;,</span>
<span class="gi">+]</span>
<span class="gi">+</span>
<span class="gi">+[profile.release.package.compiler_builtins]</span>
<span class="gi">+# The compiler-builtins crate cannot reference libcore, and it&#39;s own CI will</span>
<span class="gi">+# verify that this is the case. This requires, however, that the crate is built</span>
<span class="gi">+# without overflow checks and debug assertions. Forcefully disable debug</span>
<span class="gi">+# assertions and overflow checks here which should ensure that even if these</span>
<span class="gi">+# assertions are enabled for libstd we won&#39;t enable then for compiler_builtins</span>
<span class="gi">+# which should ensure we still link everything correctly.</span>
<span class="gi">+debug-assertions = false</span>
<span class="gi">+overflow-checks = false</span>
<span class="gi">+</span>
<span class="gi">+# For compiler-builtins we always use a high number of codegen units.</span>
<span class="gi">+# The goal here is to place every single intrinsic into its own object</span>
<span class="gi">+# file to avoid symbol clashes with the system libgcc if possible. Note</span>
<span class="gi">+# that this number doesn&#39;t actually produce this many object files, we</span>
<span class="gi">+# just don&#39;t create more than this number of object files.</span>
<span class="gi">+#</span>
<span class="gi">+# It&#39;s a bit of a bummer that we have to pass this here, unfortunately.</span>
<span class="gi">+# Ideally this would be specified through an env var to Cargo so Cargo</span>
<span class="gi">+# knows how many CGUs are for this specific crate, but for now</span>
<span class="gi">+# per-crate configuration isn&#39;t specifiable in the environment.</span>
<span class="gi">+codegen-units = 10000</span>
<span class="gi">+</span>
<span class="gi">+# These dependencies of the standard library implement symbolication for</span>
<span class="gi">+# backtraces on most platforms. Their debuginfo causes both linking to be slower</span>
<span class="gi">+# (more data to chew through) and binaries to be larger without really all that</span>
<span class="gi">+# much benefit. This section turns them all to down to have no debuginfo which</span>
<span class="gi">+# helps to improve link times a little bit.</span>
<span class="gi">+[profile.release.package]</span>
<span class="gi">+addr2line.debug = 0</span>
<span class="gi">+adler.debug = 0</span>
<span class="gi">+gimli.debug = 0</span>
<span class="gi">+miniz_oxide.debug = 0</span>
<span class="gi">+object.debug = 0</span>
<span class="gi">+</span>
<span class="gi">+[patch.crates-io]</span>
<span class="gi">+# See comments in `library/rustc-std-workspace-core/README.md` for what&#39;s going on</span>
<span class="gi">+# here</span>
<span class="gi">+rustc-std-workspace-core = { path = &#39;./rustc-std-workspace-core&#39; }</span>
<span class="gi">+rustc-std-workspace-alloc = { path = &#39;./rustc-std-workspace-alloc&#39; }</span>
<span class="gi">+rustc-std-workspace-std = { path = &#39;./rustc-std-workspace-std&#39; }</span>
<span class="gh">diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs</span>
<span class="gh">index a38391c7b88..9047a2b43a7 100644</span>
<span class="gd">--- a/src/bootstrap/metadata.rs</span>
<span class="gi">+++ b/src/bootstrap/metadata.rs</span>
<span class="gu">@@ -1,7 +1,6 @@</span>
 use std::path::PathBuf;
 use std::process::Command;

<span class="gd">-use build_helper::output;</span>
 use serde::Deserialize;

 use crate::cache::INTERNER;
<span class="gu">@@ -37,7 +36,33 @@ pub fn build(build: &amp;mut Build) {</span>
         .arg(&quot;--no-deps&quot;)
         .arg(&quot;--manifest-path&quot;)
         .arg(build.src.join(&quot;Cargo.toml&quot;));
<span class="gd">-    let output = output(&amp;mut cargo);</span>
<span class="gi">+    let output = build_helper::output(&amp;mut cargo);</span>
<span class="gi">+    let output: Output = serde_json::from_str(&amp;output).unwrap();</span>
<span class="gi">+    for package in output.packages {</span>
<span class="gi">+        if package.source.is_none() {</span>
<span class="gi">+            let name = INTERNER.intern_string(package.name);</span>
<span class="gi">+            let mut path = PathBuf::from(package.manifest_path);</span>
<span class="gi">+            path.pop();</span>
<span class="gi">+            let deps = package</span>
<span class="gi">+                .dependencies</span>
<span class="gi">+                .into_iter()</span>
<span class="gi">+                .filter(|dep| dep.source.is_none())</span>
<span class="gi">+                .map(|dep| INTERNER.intern_string(dep.name))</span>
<span class="gi">+                .collect();</span>
<span class="gi">+            build.crates.insert(name, Crate { name, id: package.id, deps, path });</span>
<span class="gi">+        }</span>
<span class="gi">+    }</span>
<span class="gi">+</span>
<span class="gi">+    // Run `cargo metadata` to figure out what crates we&#39;re testing.</span>
<span class="gi">+    let mut cargo = Command::new(&amp;build.initial_cargo);</span>
<span class="gi">+    cargo</span>
<span class="gi">+        .arg(&quot;metadata&quot;)</span>
<span class="gi">+        .arg(&quot;--format-version&quot;)</span>
<span class="gi">+        .arg(&quot;1&quot;)</span>
<span class="gi">+        .arg(&quot;--no-deps&quot;)</span>
<span class="gi">+        .arg(&quot;--manifest-path&quot;)</span>
<span class="gi">+        .arg(build.src.join(&quot;library/Cargo.toml&quot;));</span>
<span class="gi">+    let output = build_helper::output(&amp;mut cargo);</span>
     let output: Output = serde_json::from_str(&amp;output).unwrap();
     for package in output.packages {
         if package.source.is_none() {
</code></pre></div>


</div></div>



<a name="209485811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209485811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209485811">(Sep 09 2020 at 08:47)</a>:</h4>
<p>This seems to work. (excluded <code>Cargo.lock</code> changes from the diff)</p>



<a name="209552503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209552503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209552503">(Sep 09 2020 at 18:54)</a>:</h4>
<p>Opened <a href="https://github.com/rust-lang/rust/issues/76533">#76533</a></p>



<a name="209558786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242791-t-infra/topic/Separating%20rustc%20and%20library%20workspaces/near/209558786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242791-t-infra/topic/Separating.20rustc.20and.20library.20workspaces.html#209558786">(Sep 09 2020 at 19:47)</a>:</h4>
<p>Nice!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>